﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common;
using Wix.Aura.Common.CustomTypes;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class ClassInterfaceSerialization : ClassChildren {
		[Test]
		public void InterfaceSerialization() {
			Guid id = Guid.NewGuid();
			string expected = string.Format(@"<Interface Id=""{0}"" Name=""Interface"" />", id.ToString().ToUpper());
			expected = string.Format(baseXml, expected);

			Interface i = new Interface(id, "Interface");
			cl.Interface.Add(i);
			Assertion(expected, project);
		}

		[Test]
		public void AllAttributes() {
			Guid id = Guid.NewGuid();
			string expected = string.Format(@"<Interface Id=""{0}"" BaseInterface=""00000000-0000-0000-0000-000000000000"" Name=""Interface"" NumMethods=""2"" ProxyStubClassId=""00000000-0000-0000-0000-000000000000"" ProxyStubClassId32=""00000000-0000-0000-0000-000000000000"" Versioned=""yes"" />", id.ToString().ToUpper());
			expected = string.Format(baseXml, expected);

			Interface i = new Interface(id, "Interface");
			i.BaseInterface = Guid.Empty;
			i.NumMethods = 2;
			i.ProxyStubClassId = Guid.Empty;
			i.ProxyStubClassId32 = Guid.Empty;
			i.Versioned = YesNoType.Yes;
			cl.Interface.Add(i);
			Assertion(expected, project);
		}
	}
}
